package com.lesson10.composite;

import java.util.ArrayList;
import java.util.List;

/**
 * @author 朝花不迟暮
 * @version 1.0
 * @date 2020/8/31 16:39
 */
public class University extends OragizationComposite
{
    public University(String name, String desc)
    {
        super(name, desc);
    }

    List<OragizationComposite> oz =new ArrayList<>();

    @Override
    public void print()
    {
        System.out.println("============="+getName()+"==============");
        for (OragizationComposite composite : oz)
        {
            composite.print();
        }
    }

    @Override
    public String getName()
    {
        return super.getName();
    }

    @Override
    public String getDesc()
    {
        return super.getDesc();
    }

    @Override
    protected void add(OragizationComposite o)
    {
        oz.add(o);
    }

    @Override
    protected void remove(OragizationComposite o)
    {
        oz.remove(o);
    }
}
